home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_perl.idb / usr / freeware / catman / p_man / cat3 / Time::localtime.Z / Time::localtime
Encoding:
Text File  |  1998-10-28  |  2.9 KB  |  133 lines

  1.  
  2.  
  3.  
  4.      TTTTiiiimmmmeeee::::::::llllooooccccaaaallllttttiiiimmmmeeee((((3333))))22223333////JJJJuuuullll////99998888    ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222TTTT))))iiiimmmmeeee::::::::llllooooccccaaaallllttttiiiimmmmeeee((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       Time::localtime - by-name interface to Perl's    built-in
  10.       _l_o_c_a_l_t_i_m_e() function
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.        use Time::localtime;
  14.        printf "Year    is %d\n", localtime->year() + 1900;
  15.  
  16.        $now    = ctime();
  17.  
  18.        use Time::localtime;
  19.        use File::stat;
  20.        $date_string    = ctime(stat($file)->mtime);
  21.  
  22.  
  23.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  24.       This module's    default    exports    override the core _l_o_c_a_l_t_i_m_e()
  25.       function, replacing it with a    version    that returns
  26.       "Time::tm" objects.  This object has methods that return the
  27.       similarly named structure field name from the    C's tm
  28.       structure from _t_i_m_e._h; namely    sec, min, hour,    mday, mon,
  29.       year,    wday, yday, and    isdst.
  30.  
  31.       You may also import all the structure    fields directly    into
  32.       your namespace as regular variables using the    :FIELDS    import
  33.       tag.    (Note that this    still overrides    your core functions.)
  34.       Access these fields as variables named with a    preceding tm_
  35.       in front their method    names.    Thus, $tm_obj->mday()
  36.       corresponds to $tm_mday if you import    the fields.
  37.  
  38.       The _c_t_i_m_e() funtion provides a way of    getting    at the scalar
  39.       sense    of the original    _C_O_R_E::_l_o_c_a_l_t_i_m_e() function.
  40.  
  41.       To access this functionality without the core    overrides,
  42.       pass the use an empty    import list, and then access function
  43.       functions with their full qualified names.  On the other
  44.       hand,    the built-ins are still    available via the CORE::
  45.       pseudo-package.
  46.  
  47.      NNNNOOOOTTTTEEEE
  48.       While    this class is currently    implemented using the
  49.       Class::Struct    module to build    a struct-like class, you
  50.       shouldn't rely upon this.
  51.  
  52.      AAAAUUUUTTTTHHHHOOOORRRR
  53.       Tom Christiansen
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                        (printed 10/23/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      TTTTiiiimmmmeeee::::::::llllooooccccaaaallllttttiiiimmmmeeee((((3333))))22223333////JJJJuuuullll////99998888    ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222TTTT))))iiiimmmmeeee::::::::llllooooccccaaaallllttttiiiimmmmeeee((((3333))))
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.      Page 2                        (printed 10/23/98)
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.